import { h, defineComponent, ref, watch, reactive, toRefs, toRef } from "@vue/runtime-core";
import enemyPlaneImg from "../../assets/enemy_plane.png";
export default defineComponent({
	props: ["x", "y","planeIndex"],
	setup(props, ctx) {
		// 方案二 使用 toRefs() 将 props 对象转为响应式对象
		const { x, y } = toRefs(props);
		const planeIndex = props["planeIndex"];
		return {
			x,
			y,
			planeIndex
		}
	},
	render(ctx) {
		return h("Container", { x: ctx.x, y: ctx.y }, [h("Sprite", { texture: enemyPlaneImg },`${ctx.planeIndex}`)])
	}
})